package com.yx.pc.api.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.yx.pc.api.service.PcTdBannerService;
import com.yx.system.dao.TdBannerMapper;
import com.yx.system.entity.TdBanner;
import com.yx.system.service.TdBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * Created by wuye on 2017/12/18.
 */
@Service
public class PcTdBannerServiceImpl implements PcTdBannerService {

    @Autowired
    private TdBannerMapper tdBannerMapper;

    @Override
    @Transactional
    public int save(TdBanner tdBanner) {
        return tdBannerMapper.insert(tdBanner);
    }

    @Override
    @Transactional
    public int update(TdBanner tdBanner) {
        return tdBannerMapper.updateByPrimaryKey(tdBanner);
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return tdBannerMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TdBanner record) {
        return tdBannerMapper.insert(record);
    }

    @Override
    public int insertSelective(TdBanner record) {
        return tdBannerMapper.insertSelective(record);
    }

    @Override
    public TdBanner selectByPrimaryKey(Integer id) {
        return tdBannerMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(TdBanner record) {
        return tdBannerMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TdBanner record) {
        return tdBannerMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<TdBanner> findBanner() {
        return tdBannerMapper.findBanner();
    }

    @Override
    public List<TdBanner> queryList(Map<String, Object> map) {
        return tdBannerMapper.queryList(map);
    }

    @Override
    public Page<TdBanner> queryPageList(Page<TdBanner> page, Map<String, Object> map) {
        page.setRecords(tdBannerMapper.queryPageList(page, map));
        return page;
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return tdBannerMapper.queryTotal(map);
    }
}
